home *** CD-ROM | disk | FTP | other *** search
Wrap
ccccllll CCCCrrrreeeeaaaatttteeee////DDDDeeeessssttttrrrrooooyyyy IIIImmmmpppplllliiiicccciiiitttt BBBBuuuuffffffffeeeerrrrssss((((3333ddddmmmm)))) NNNNAAAAMMMMEEEE clCreateBuf, clDestroyBuf, clQueryBufferHdl, clQueryHandle - Create and destroy implicit buffers, and find related handles. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////ccccllll....hhhh>>>> CCCCLLLLbbbbuuuuffffffffeeeerrrrHHHHddddllll ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff((((CCCCLLLLhhhhaaaannnnddddlllleeee hhhhaaaannnnddddlllleeee,,,, iiiinnnntttt bbbbuuuuffffffffeeeerrrrTTTTyyyyppppeeee,,,, iiiinnnntttt bbbblllloooocccckkkkssss,,,, iiiinnnntttt bbbblllloooocccckkkkSSSSiiiizzzzeeee,,,, vvvvooooiiiidddd ********bbbbuuuuffffffffeeeerrrrPPPPttttrrrr1111)))) iiiinnnntttt ccccllllDDDDeeeessssttttrrrrooooyyyyBBBBuuuuffff((((CCCCLLLLbbbbuuuuffffffffeeeerrrrHHHHddddllll bbbbuuuuffffffffeeeerrrrHHHHddddllll)))) CCCCLLLLbbbbuuuuffffffffeeeerrrrHHHHddddllll ccccllllQQQQuuuueeeerrrryyyyBBBBuuuuffffffffeeeerrrrHHHHddddllll((((CCCCLLLLhhhhaaaannnnddddlllleeee hhhhaaaannnnddddlllleeee,,,, iiiinnnntttt bbbbuuuuffffffffeeeerrrrTTTTyyyyppppeeee,,,, vvvvooooiiiidddd ********bbbbuuuuffffffffeeeerrrrPPPPttttrrrr2222)))) CCCCLLLLhhhhaaaannnnddddlllleeee ccccllllQQQQuuuueeeerrrryyyyHHHHaaaannnnddddlllleeee((((CCCCLLLLbbbbuuuuffffffffeeeerrrrHHHHddddllll bbbbuuuuffffffffeeeerrrrHHHHddddllll)))) AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS _h_a_n_d_l_e A handle to the compressor or decompressor. _b_u_f_f_e_r_T_y_p_e The type of buffer, either CCCCLLLL____BBBBUUUUFFFF____FFFFRRRRAAAAMMMMEEEE or CCCCLLLL____BBBBUUUUFFFF____CCCCOOOOMMMMPPPPRRRREEEESSSSSSSSEEEEDDDD. _b_l_o_c_k_s The number of blocks in the buffer. _b_l_o_c_k_S_i_z_e The size in bytes of each block. This must be equal to the frame size for CL_BUF_FRAME, and 1 for CL_BUF_COMPRESSED. _b_u_f_f_e_r_P_t_r_1 A pointer to a pointer to the buffer space. If _b_u_f_f_e_r_P_t_r_1 is NULL, ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff will allocate the blocks. If _b_u_f_f_e_r_P_t_r_1 is not NULL and *_b_u_f_f_e_r_P_t_r_1 is NULL, ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff will allocate the blocks and set *_b_u_f_f_e_r_P_t_r_1 to point to the new space. Otherwise, the space at *_b_u_f_f_e_r_P_t_r_1 will be managed as the ring buffer. See the NOTES section below for more information. _b_u_f_f_e_r_H_d_l The handle to the buffer. _b_u_f_f_e_r_P_t_r_2 A pointer to a pointer to the buffer space. If _b_u_f_f_e_r_P_t_r_2 is not NULL, ccccllllQQQQuuuueeeerrrryyyyBBBBuuuuffffffffeeeerrrrHHHHddddllll will set *_b_u_f_f_e_r_P_t_r_2 to point to the buffer space. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff is used to create a CL ring buffer. These ring buffers are needed for the "Implicit Buffering" model of data processing, where buffers are not specified in the processing call. Implicit buffering is invoked for ccccllllCCCCoooommmmpppprrrreeeessssssss and ccccllllDDDDeeeeccccoooommmmpppprrrreeeessssssss by giving NULL as the frameBuffer or compressedBuffer. Compressors and decompressors have buffers of type CL_BUF_FRAME and CL_BUF_COMPRESSED. Buffer space may be allocated by either the application or the library. The former is useful if there already exists memory space that contains PPPPaaaaggggeeee 1111 ccccllll CCCCrrrreeeeaaaatttteeee////DDDDeeeessssttttrrrrooooyyyy IIIImmmmpppplllliiiicccciiiitttt BBBBuuuuffffffffeeeerrrrssss((((3333ddddmmmm)))) data to be processed, or holds results to be read. In this case, creating the ring buffer directly from this memory saves on potential copies to or from the CL buffer. ccccllllDDDDeeeessssttttrrrrooooyyyyBBBBuuuuffff is used to deallocate the CL buffer. ccccllllQQQQuuuueeeerrrryyyyBBBBuuuuffffffffeeeerrrrHHHHddddllll is used to find the buffer handle from a compressor or decompressor handle. ccccllllQQQQuuuueeeerrrryyyyHHHHaaaannnnddddlllleeee is used to find the processing object handle from a buffer handle. An application may read from and write to these buffers using the additional calls ccccllllQQQQuuuueeeerrrryyyyFFFFrrrreeeeeeee, ccccllllUUUUppppddddaaaatttteeeeHHHHeeeeaaaadddd, ccccllllQQQQuuuueeeerrrryyyyVVVVaaaalllliiiidddd, ccccllllUUUUppppddddaaaatttteeeeTTTTaaaaiiiillll, and ccccllllDDDDoooonnnneeeeUUUUppppddddaaaattttiiiinnnnggggHHHHeeeeaaaadddd. NNNNOOOOTTTTEEEESSSS Some schemes may have constraints on the alignment of their buffers. Specifying the _b_u_f_f_e_r_P_t_r_1 argument to ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff as NULL and then using only the read/write functions will allow the application to work with every scheme. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS ccccllllCCCCrrrreeeeaaaatttteeeeBBBBuuuuffff returns the buffer handle used in subsequent buffering calls, or NULL on failure. ccccllllDDDDeeeessssttttrrrrooooyyyyBBBBuuuuffff returns SUCCESS, or a negative error code on failure. ccccllllQQQQuuuueeeerrrryyyyBBBBuuuuffffffffeeeerrrrHHHHddddllll returns the handle to the buffer, or NULL on failure. ccccllllQQQQuuuueeeerrrryyyyHHHHaaaannnnddddlllleeee returns the handle to the processing object, or NULL on failure. EEEEXXXXAAAAMMMMPPPPLLLLEEEE #include <dmedia/cl.h> CLhandle handle; CLbufferHdl bufferHdl; void *buffer; ... clOpenCompressor(CL_MVC1_SOFTWARE, &handle); ... /* Create a buffer of 10 blocks of size 10000 */ buffer = malloc(10*10000); bufferHdl = clCreateBuf(handle, CL_BUF_FRAME, 10, 10000, &buffer); bufferHdl = clQueryBufferHdl(handle, CL_BUF_FRAME, &buffer); handle = clQueryHandle(bufferHdl); ... clDestroyBuf(bufferHdl); clCloseCompressor(handle); PPPPaaaaggggeeee 2222 ccccllll CCCCrrrreeeeaaaatttteeee////DDDDeeeessssttttrrrrooooyyyy IIIImmmmpppplllliiiicccciiiitttt BBBBuuuuffffffffeeeerrrrssss((((3333ddddmmmm)))) SEE ALSO CLintro(3dm), clQueryFree(3dm), clUpdateHead(3dm), clQueryValid(3dm), clUpdateTail(3dm), clDoneUpdatingHead(3dm) PPPPaaaaggggeeee 3333